# coding=utf-8
import wx
import wx.html
from TechDao import TechDao

class TechView(wx.Frame):
    
   def __init__(self,mainframe,viewtype,id):        
        wx.Frame.__init__(self,None,-1,'',style=wx.DEFAULT_FRAME_STYLE ^ (wx.RESIZE_BORDER),size=(600,400))
        self.mainframe=mainframe       
        self.id=id
        self.Center()
        techdao=TechDao()
        row=techdao.select("and id=%s"%(self.id))[0]
        self.SetTitle( row[1])
        if viewtype=='text':
            self.contenttext = wx.TextCtrl(self, -1,style=wx.TE_MULTILINE|wx.TE_DONTWRAP)
            self.contenttext.SetValue(row[4])
        if viewtype=='html':
            self.contenttext= wx.html.HtmlWindow(self)
            self.contenttext.SetPage(row[4])
        self.Maximize()


